package de.tabuma.pm.gadget.view;

import de.tabuma.pm.*;
import de.tabuma.lib.tabumaview;
import java.io.PrintWriter;
import java.util.*;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author alefen
 */
public class create extends tabumaview {
    public create(String servlet, Hashtable hashtable) {
        super(servlet, hashtable);
    }

    @Override
    public void processRequest(ServletContext context, HttpServletRequest request, HttpServletResponse response, PrintWriter out) {
        String text = "add gadget";
        String name = "name";
        String cancel = "cancel";
        out.println(getFormBeginn(constants.gadgetA));
        out.println("<div class=\"cols\">");
        out.println("<div class=\"col1\">");
        out.println(printForm1(name, constants.GADGET_NAME, null));
        out.println("</div>");
        out.println("</div>");
        out.println(getHiddenAsAttribute());
        out.println(printHiddenField(constants.projectId, (String) request.getAttribute(constants.projectId)));
        out.println(printHiddenField(constants.gadgetActionId, ""+constants.GADGET_ACTION_CREATE));
        out.println(printHiddenField(constants.GADGET_ACTION_CREATE1, "1"));
        out.println("<p><input type=\"submit\" class=\"button\" name=\"create\" value=\""+text+"\"/> <input type=\"submit\" class=\"button\" name=\"" + constants.cancel + "\" value=\""+cancel+"\"/></p>");
        out.println(getFormEnd());
    }
}